package org.example.order.bootstrap;

import org.example.cache.spring.EnableMultiLayerCaching;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;

@SpringBootApplication(
        scanBasePackages = {
                "org.example.order.bootstrap.config",
                "org.example.order.controller",
                "org.example.order.aop",
                "org.example.order.infrastructure",
                "org.example.integration",
                "org.example.mock",
                "org.example.order.service"
        }
)
@EnableMultiLayerCaching(
        cachingPointcutBasePackages = {"org.example.integration.adapter"},
        apiPointcutBasePackages = {"org.example.order.controller"}
)
//@ImportResource(locations = {"classpath:simple-aop-app-context.xml"})
public class OrderApplication implements ApplicationListener<ContextRefreshedEvent> {
//    private static final Logger logger = org.slf4j.LoggerFactory.getLogger(OrderApplication.class);

    public static void main(String[] args) {
        SpringApplication.run(OrderApplication.class, args);
    }

    @Override
    public void onApplicationEvent(ContextRefreshedEvent event) {
//        String[] names = event.getApplicationContext().getBeanDefinitionNames();
//        for (String name : names) {
//            logger.info(name);
//        }
    }
}
